import axios from '@/libs/api.request'

/**
 * 获取系统消息列表
 */
export const getSystemMessageList = (pageId) => {
  return axios.request({
    url: 'SystemMessage/getSystemMessageList',
    method: 'post',
    data: {pageId}
  })
}

/**
 * 获取系统消息详情
 */
export const getSystemMessageDetail = (id) => {
  return axios.request({
    url: 'SystemMessage/getSystemMessageDetail',
    data: { id: id },
    method: 'post'
  })
}

/**
 * 编辑/新增系统消息
 */
export const editSystemMessage = ({ id, content,  uid, title }) => {
  const data = {
    id, content,  uid, title
  }
  return axios.request({
    url: 'SystemMessage/editSystemMessage',
    data,
    method: 'post'
  })
}


/**
 * 删除系统消息
 */
export const delSystemMessage = (id) => {
  return axios.request({
    url: 'SystemMessage/delSystemMessage',
    data: { id: id },
    method: 'post'
  })
}
